<template>
  <div>
  展示没绑定学生列表
  <ul>
  <li v-for='i in stulist'>{{i.name}}
  <button @click='bind(i.id)'>绑定</button>
    </li>
    </ul>
    </div>
    </template>
    <script>
  export default {
    data(){
      return{
        stulist:[]
      }
    },
    methods: {
      getStulist(){
        this.axios.get('users/stuN/').then(res=>{
          this.stulist=res.data.list
        })
      },
      bind(id){
        let tid = localStorage.getItem('tuserid')
        this.axios.put('users/stuN/?id='+id+'&tid='+tid).then(res=>{
        })
      }
    },
    mounted() {
      this.getStulist()
    },
  }
  </script>
  <style lang="">

  </style>
